var controller = {};

controller.login = function(req, res, next){
    var ql = 'select tel, pw from user where tel=' + req.query.account + ' and pw=' + req.query.password;
    conn.query(ql, function(err, results, fields) {
        if (err) throw err;

        if (!results || results.length <= 0){
             console.log('账号或密码错误')
             res.send({
                 code: 400
             })
        } else {
            console.log('The solution is: ', results);
            res.send({
                code: 200,
                results
            })
        }
    });
}

module.exports = controller;